package org.jim.server.demo.controller;

import org.jim.server.demo.common.CommonResult;
import org.jim.server.demo.entity.ImMessage;
import org.jim.server.demo.mapper.ImMessageMapper;
import org.jim.server.demo.service.ImMessageService;
import org.jim.server.demo.service.impl.ImMessageServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 即时通讯消息表 前端控制器
 * </p>
 *
 * @author lml
 * @since 2025-03-25
 */
@RestController
@RequestMapping("/im/imMessage")
public class ImMessageController {


    /**
     * TODO 注册 Service 注册失败；暂时直接注册 ImMessageServiceImpl
     */
    @Resource
    private ImMessageServiceImpl iImsMessageService;


    @GetMapping("/list")
    public CommonResult<List<ImMessage>> list() {

        List<ImMessage> list = iImsMessageService.list();

        return CommonResult.successResponse(list);
    }

    @GetMapping("/test")
    public CommonResult<String> test() {

        return CommonResult.successResponse("test");
    }
}
